// -----------------------------------------------
// Author:     code34 nicolas_boiteux@yahoo.fr
// Edited by:  Neumatic
// Warcontext: Civilian build thing
// -----------------------------------------------

private ["_needpropagander","_unit","_position"];

_unit = _this select 0;

_needpropagander = true;

{
	if (_x distance _unit < 500) then {
		_needpropagander = false;
	};
	if (isNull _x) then {wcpropagander = wcpropagander - [_x]};
} foreach wcpropagander;

if (!_needpropagander) exitWith {};

wcpropagander = wcpropagander + [_unit];

diag_log format ["WARCONTEXT: BUILD 1 BUILDER - FAME: %1", wcfame];

_position = (position _unit) findEmptyPosition [8, 100];
if (_position select 0 == 0) then {
	diag_log "WARCONTEXT: CANNOT FIND EMPTY POSITION FOR CIVILIAN BUILDER";
} else {
	_unit setPos _position;
};

while {alive _unit} do {
	sleep 1;
};